package collections.g3;

public class HashTestElement {

	private int x;
	private int y;
	private int z;
	private String id;

	public HashTestElement(int x, int y, int z) {
		this.x = x;
		this.y = y;
		this.z = z;
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof HashTestElement)) {
			return false;
		}
		HashTestElement e = (HashTestElement) obj;
		//return e.x == this.x && e.y == this.y && e.z == this.z;
		return this.id.equalsIgnoreCase(e.id);
	}

	@Override
	public int hashCode() {
		// convention: o1.equals(o2) == true => o1.hashCode() == o2.hashCode()!
		return id.toLowerCase().hashCode();
	}

}
